const mongoose = require('mongoose');
const Schema = mongoose.Schema;

var date = new Date()
var mydate = date.toLocaleString("zh-CN")

// Create Schema
const SupplierSchema = new Schema({
  name: {
    type: String,
    required: true
  },
  orderName: {
    type: String,
    required: true
  },

  describe: {
    type: String
  },
  price: {
    type: Number,
    required: true
  },
  head: {
    type: String,
    required: true
  },
  phoneNumber: {
    type: String,
    required: true
  },

  date: {
    type: String,
    default: mydate
  }
});

module.exports = Supplier = mongoose.model('supplier', SupplierSchema);